package com.xu.cloud.common.filter;

import com.xu.cloud.common.util.ResourceUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

/**
 * 基础请求过滤器, 不过滤静态资源请求
 *
 * @author xuguan
 * @since 2025/1/8
 */
@Slf4j
public abstract class BaseRequestFilter extends OncePerRequestFilter {
    @Override
    protected boolean shouldNotFilter(HttpServletRequest request) throws ServletException {
        return ResourceUtil.isStatic(request.getRequestURI());
    }
}
